package models

import (
	"time"
)

// OrderStatusLog 订单状态日志表
type OrderStatusLog struct {
	ID           uint64    `gorm:"primaryKey;autoIncrement;comment:主键ID" json:"id"`
	OrderID      uint64    `gorm:"not null;index;comment:订单ID" json:"order_id"`
	FromStatus   int8      `gorm:"type:tinyint;comment:原状态" json:"from_status"`
	ToStatus     int8      `gorm:"type:tinyint;not null;comment:目标状态" json:"to_status"`
	StatusType   int8      `gorm:"type:tinyint;not null;index;comment:状态类型(1-订单状态,2-支付状态,3-合同状态)" json:"status_type"`
	OperatorID   string    `gorm:"type:varchar(64);not null;index;comment:操作人ID" json:"operator_id"`
	OperatorType int8      `gorm:"type:tinyint;not null;comment:操作人类型(1-租客,2-房东,3-中介,4-系统,5-客服)" json:"operator_type"`
	OperatorName string    `gorm:"type:varchar(100);comment:操作人名称" json:"operator_name"`
	Reason       string    `gorm:"type:varchar(500);comment:原因" json:"reason"`
	Remark       string    `gorm:"type:text;comment:备注" json:"remark"`
	IPAddress    string    `gorm:"type:varchar(50);comment:IP地址" json:"ip_address"`
	UserAgent    string    `gorm:"type:varchar(500);comment:用户代理" json:"user_agent"`
	CreatedAt    time.Time `gorm:"autoCreateTime;index;comment:创建时间" json:"created_at"`
	NewStatus    int       `gorm:"type:tinyint;not null;" json:"new_status"`
	OldStatus    int       `gorm:"type:tinyint;not null;" json:"old_status"`
	OrderNo      string    `gorm:"type:varchar(32);not null;index;comment:订单号" json:"order_no"`
}
